package com.qingke.POJO;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import com.opensymphony.xwork2.ActionSupport;

public class StreamAction extends ActionSupport{
	private InputStream inputStream;
	private String filename;
	
	public StreamAction(){
		
	}
	
	public InputStream getInputStream() {
		return inputStream;
	}

	public void setInputStream(InputStream inputStream) {
		this.inputStream = inputStream;
	}

	public String getFilename() {
		return filename;
	}

	public void setFilename(String filename) {
		this.filename = filename;
	}

	public String exectue(){
		String file = "D:/Brackets/samples/root/Getting Started/my/WebContent/img/zhuroufu.jpg";
		System.out.println(file);
		try {
			inputStream = new FileInputStream(new File(file));
			filename = "download.jpg";
			System.out.println(filename);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return ERROR;
		}
		System.out.println("good");
		return SUCCESS;
	}
}
